VtToggleButton


Create a ToggleButton

Syntax

VtToggleButton object_name [options]

Description

Creates a ToggleButton. Returns the widget name. The button may be labeled using the standard Label class options.

Options

-callback cmd (C)
Sets the callback cmd to call when the ToggleButton is activated.

Additional callback keys

set
the state of the ToggleButton.

-set boolean (CSG)
Sets the state of a specified ToggleButton.

-value boolean (CSG)
Sets whether the state of the ToggleButton is on or off.

Additional callback keys

set
boolean, the state of the ToggleButton

value
boolean, the state of the ToggleButton

Example

The following code produces three ToggleButtons with appropriate labels.

set app [VtOpen ToggleButtons]

set fn [VtFormDialog $app.fn -title "VtToggleButton Demo" ]

VtToggleButton $fn.but1 -label "Apples"
VtToggleButton $fn.but2 -label "Oranges"
VtToggleButton $fn.but3 -label "Kumquats"

VtShow $fn
VtMainLoop

This code produces the following:

See also: